package org.shopen.puremvc.view.components
{
	import flash.geom.Point;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.mediator.Mediator;
	import org.shopen.puremvc.ApplicationConstants;
	import org.shopen.puremvc.view.components.statusbar.StatusBar;

	public class StatusbarMediator extends Mediator
	{
		public static const NAME : String = "StatusbarMediator";
		
		protected function get statusbar() : StatusBar
		{
			var result : StatusBar = viewComponent as StatusBar;
			return result;
		}
		
		public function StatusbarMediator(viewComponent:Object=null)
		{
			super(StatusbarMediator.NAME, viewComponent);
		}
		
		override public function getMediatorName():String
		{
			return StatusbarMediator.NAME;
		}
		
		override public function listNotificationInterests():Array
		{
			return [ApplicationConstants.MOUSE_POSITION_CHANGED];
		}
		
		override public function handleNotification(notification:INotification):void
		{			
			var body : Object = notification.getBody();
			switch(notification.getName())
			{
				case ApplicationConstants.MOUSE_POSITION_CHANGED:
					statusbar.mousePoint = body as Point;
					break;
			}
		}
		
	}
}